﻿@model Vnsf.WebHost.Models.BudgetBindingModel

@{
    ViewBag.Title = "Budget";
}

<h2>Budget</h2>
<ul class="nav nav-pills">
    <li>
        @{ var url = @Url.Action("Budgets"); }
        <a data-bind="attr: { href: '@url#' + $data.parentID() }">
            <i class="icon-arrow-left"></i>Back to Budgets
        </a>
    </li>
</ul>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>BudgetBindingModel</h4>
        <hr />
        @Html.ValidationSummary(true)

        <div class="form-group">
            @Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <input type="text" class="form-control" data-bind="value: name" placeholder="Grant code" />
                @Html.ValidationMessageFor(model => model.Name)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <input type="text" class="form-control" data-bind="value: description" placeholder="Grant code" />
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.FinancialYear, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <input type="text" class="form-control" data-bind="value: financialYear" placeholder="Grant code" />
                @Html.ValidationMessageFor(model => model.FinancialYear)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Amount, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <input type="text" class="form-control" data-bind="value: amount" placeholder="Grant code" />
                @Html.ValidationMessageFor(model => model.Amount)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.SupplierId, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <select class="form-control" data-bind="value: supplierId, options: organizations, optionsText: 'name', optionsValue: 'id', optionsCaption: 'Choose...'"></select>
                @Html.ValidationMessageFor(model => model.SupplierId)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" data-bind="click: save" />
            </div>
        </div>
    </div>
}

@section scripts
{
    <script src="~/Areas/Admin/Scripts/Budget.js"></script>
}
